/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/*!
  \file vcgui3.h
  \author Cory Dixon
*/

#ifndef __VCGUI3_H
#define __VCGUI3_H

#include "threadedPipe.h"
#include "gtkMap.h"
#include "nodeList.h"
#include "nodeWindow.h"

  /*<-------Defines--------->*/
  /*<------End Defines------>*/

class VCGUI : public ThreadedPipe
{
private:
	// GTK gui interface
	GtkWidget * main_window;
	GtkWidget * datebar;
	GtkWidget * toolbar;
	GtkWidget * win_vbox;
	GtkWidget * map_frame;
	GtkWidget * mouse_location;
	GtkWidget * node_list_frame;
	GtkWidget * layer_list_frame;
	GtkWidget * search_entry;

	bool isFullScreen;

	void createMap();
	void exit();

	static gboolean updateTime(gpointer user_data);
	static gboolean vc_key_handler(GtkWidget * widget, GdkEventKey * event, gpointer user_data);
	static gboolean vc_window_destroy(GtkWidget * widget, GdkEventKey * event, gpointer user_data);
	static void vc_window_exit(GtkWidget * widget, gpointer user_data);
	static gboolean search_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_data);

	GtkWidget * create_quit_dialog (void);

public:
	VCGUI(String name, int argc, char * argv[]);
	~VCGUI();

	bool init(ShmStruct * shmStructPtr);
	void update();

	GtkBuilder * getBuilder();

	// we make these public since they have well defined interfaces
	NodeWindow node_windows[MAX_CLIENTS]; // list of node windows
	NodeList   node_list;
	GPSMap     map;
};

#endif //define
